import QtQuick 2.8
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3
import QtWeChat 1.0
import "./controls"

Pane {
    id: root

    property WeChatContactModel model

    width: 250
    padding: 0
    background: Rectangle {
        color: "#EEEEEE"
    }

    ColumnLayout {
        anchors.fill: parent
        spacing: 12

        ContactSearch {
            id: search
            Layout.topMargin: 24
            Layout.leftMargin: 12
            Layout.rightMargin: 12
            Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
            onTextChanged: {
                root.model.filterWord = search.text;
            }
        }

        ContactList {
            Layout.fillHeight: true
            Layout.fillWidth: true
            model: root.model
        }
    }
}
